package com.glasses.primework;

import javax.faces.bean.ManagedBean;
import org.primefaces.event.map.OverlaySelectEvent;
import org.primefaces.model.map.Circle;
import org.primefaces.model.map.DefaultMapModel;
import org.primefaces.model.map.LatLng;
import org.primefaces.model.map.MapModel;
import org.primefaces.model.map.Marker;
import org.primefaces.model.map.Polygon;
import org.primefaces.model.map.Polyline;
import org.primefaces.model.map.Rectangle;

@ManagedBean
public class GMapBean {
    private final MapModel model = new DefaultMapModel();
    
    public GMapBean() {
        /*
        model.addOverlay(new Marker(new LatLng(36.879466, 30.667648), "M1"));
        */
        
        Polyline polyline = new Polyline();
        polyline.getPaths().add(new LatLng(36.879466, 30.667648));
        polyline.getPaths().add(new LatLng(36.883707, 30.689216));
        polyline.getPaths().add(new LatLng(36.879703, 30.706707));
        polyline.getPaths().add(new LatLng(36.885233, 37.702323));
        model.addOverlay(polyline);
        /*
        Polygon polygon = new Polygon();
        polyline.getPaths().add(new LatLng(36.879466, 30.667648));
        polyline.getPaths().add(new LatLng(36.883707, 30.689216));
        polyline.getPaths().add(new LatLng(36.879703, 30.706707));
        model.addOverlay(polygon);
        
        Circle circle = new Circle(new LatLng(36.879466, 30.667648), 500);
        model.addOverlay(circle);
        */
    }
    
    public MapModel getModel() { return this.model; }
}
